define(['app'], function(app) {
	'use strict';

	var controller = function controller($scope, Statistics_second_agent,$ionicSlideBoxDelegate,$stateParams) {

		//接收参数
		$scope.input = new Object();
		$scope.act_id = $stateParams.act_id;
		console.log($scope.act_id);
		$scope.auction_nums = new Object();

		//滑动切换
		$scope.selectTab = 0;
		$scope.activeSlide = function(index) {
			$scope.selectTab = index;
			$ionicSlideBoxDelegate.$getByHandle('tab-handle').slide(index);
		};
	    //滑动切换
		$scope.slideChanged = function(index) {
			$scope.selectTab = index;
		};
		//加载数据
		$scope.init_data = function() {
			//取得热销的商品列表
			Statistics_second_agent.getinfo($scope.input.id, function(data) {
				$scope.datas = data;
			});
		}
		$scope.init_data(); //必须在定义之后

	}

	controller.$inject = ['$scope', 'Statistics_second_agent','$ionicSlideBoxDelegate','$stateParams'];

	return app.registerController("statistics_second_agentctrl",controller);
});


